package com.livery.data.creators;

import javax.swing.JFrame;

import com.livery.data.Transaction;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import java.awt.GridLayout;
import javax.swing.border.TitledBorder;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.FlowLayout;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import java.awt.GridBagLayout;
import javax.swing.BoxLayout;
import javax.swing.JSpinner;
import javax.swing.border.BevelBorder;
import javax.swing.border.EmptyBorder;
import com.toedter.calendar.JDateChooser;
import javax.swing.LayoutStyle.ComponentPlacement;
import java.awt.Font;

public class TransactionCreator extends JFrame implements Creator<Transaction> {
	public TransactionCreator() {
		
		JPanel panel = new JPanel();
		getContentPane().add(panel, BorderLayout.CENTER);
		panel.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_10 = new JPanel();
		panel.add(panel_10);
		panel_10.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_3 = new JPanel();
		panel_10.add(panel_3);
		panel_3.setLayout(new GridLayout(0, 2, 0, 0));
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "Samoch\u00F3d", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, null));
		panel_3.add(panel_1);
		panel_1.setLayout(new GridLayout(0, 1, 0, 0));
		
		JPanel panel_4 = new JPanel();
		panel_4.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Model", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_1.add(panel_4);
		panel_4.setLayout(new BorderLayout(0, 0));
		
		JLabel lblModel = new JLabel("Model");
		panel_4.add(lblModel);
		
		JPanel panel_5 = new JPanel();
		panel_5.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Marka", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_1.add(panel_5);
		panel_5.setLayout(new BorderLayout(0, 0));
		
		JLabel lblMaker = new JLabel("Marka");
		panel_5.add(lblMaker);
		
		JPanel panel_6 = new JPanel();
		panel_6.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Numer rejestracyjny", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_1.add(panel_6);
		panel_6.setLayout(new BorderLayout(0, 0));
		
		JLabel lblRegister = new JLabel("register");
		panel_6.add(lblRegister);
		
		JPanel panel_16 = new JPanel();
		panel_16.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Kaucja", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, null));
		panel_1.add(panel_16);
		panel_16.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
		
		JLabel lblDeposit = new JLabel("1000zl");
		panel_16.add(lblDeposit);
		
		JPanel panel_13 = new JPanel();
		panel_13.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Cena za dzie\u0144", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, null));
		panel_1.add(panel_13);
		panel_13.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
		
		JLabel lblPrice = new JLabel("100zl");
		panel_13.add(lblPrice);
		
		JPanel panel_2 = new JPanel();
		panel_2.setBorder(new TitledBorder(null, "Klient", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_3.add(panel_2);
		panel_2.setLayout(new GridLayout(3, 0, 0, 0));
		
		JPanel panel_7 = new JPanel();
		panel_7.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Imi\u0119", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_2.add(panel_7);
		panel_7.setLayout(new BorderLayout(0, 0));
		
		JLabel lblName = new JLabel("Name");
		panel_7.add(lblName, BorderLayout.NORTH);
		
		JPanel panel_9 = new JPanel();
		panel_9.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Nazwisko", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_2.add(panel_9);
		panel_9.setLayout(new BorderLayout(0, 0));
		
		JLabel lblSurname = new JLabel("Surname");
		panel_9.add(lblSurname, BorderLayout.NORTH);
		
		JPanel panel_8 = new JPanel();
		panel_8.setBorder(new TitledBorder(new EmptyBorder(0, 0, 0, 0), "Dow\u00F3d osobisty", TitledBorder.LEADING, TitledBorder.ABOVE_TOP, null, new Color(59, 59, 59)));
		panel_2.add(panel_8);
		panel_8.setLayout(new BorderLayout(0, 0));
		
		JLabel lblDocumentid = new JLabel("documentID");
		panel_8.add(lblDocumentid, BorderLayout.NORTH);
		
		JPanel panel_11 = new JPanel();
		panel_10.add(panel_11, BorderLayout.SOUTH);
		
		JLabel label = new JLabel("Wynajem na okres: ");
		
		JSpinner spinner = new JSpinner();
		
		JDateChooser dateChooser = new JDateChooser();
		
		JLabel label_1 = new JLabel("Cena Całkowita:");
		
		JLabel lblTerminZwrotu = new JLabel("Termin Zwrotu:");
		
		JLabel lblzl = new JLabel("11239zl");
		lblzl.setFont(new Font("Arial Black", Font.BOLD, 14));
		GroupLayout gl_panel_11 = new GroupLayout(panel_11);
		gl_panel_11.setHorizontalGroup(
			gl_panel_11.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_11.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel_11.createParallelGroup(Alignment.TRAILING, false)
						.addComponent(label_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
						.addComponent(label, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
						.addComponent(lblTerminZwrotu, Alignment.LEADING))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_11.createParallelGroup(Alignment.LEADING)
						.addComponent(dateChooser, GroupLayout.PREFERRED_SIZE, 227, GroupLayout.PREFERRED_SIZE)
						.addComponent(spinner, GroupLayout.PREFERRED_SIZE, 169, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblzl))
					.addContainerGap(125, Short.MAX_VALUE))
		);
		gl_panel_11.setVerticalGroup(
			gl_panel_11.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_11.createSequentialGroup()
					.addGroup(gl_panel_11.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_panel_11.createSequentialGroup()
							.addComponent(spinner, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addComponent(dateChooser, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE))
						.addGroup(gl_panel_11.createSequentialGroup()
							.addComponent(label, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
							.addGap(18)
							.addComponent(lblTerminZwrotu)))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel_11.createParallelGroup(Alignment.BASELINE)
						.addComponent(label_1, GroupLayout.PREFERRED_SIZE, 27, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblzl))
					.addGap(27))
		);
		panel_11.setLayout(gl_panel_11);
		
		JPanel panel_12 = new JPanel();
		FlowLayout flowLayout = (FlowLayout) panel_12.getLayout();
		flowLayout.setAlignment(FlowLayout.RIGHT);
		panel.add(panel_12, BorderLayout.SOUTH);
		
		JButton btnAnuluj = new JButton("Anuluj");
		panel_12.add(btnAnuluj);
		
		JButton btnDalej = new JButton("Dalej");
		panel_12.add(btnDalej);
	}

	Transaction object;
	
	@Override
	public void show() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void done() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setObject(Transaction object) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isObject() {
		// TODO Auto-generated method stub
		return false;
	}
}
